﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using MyInterBase;

namespace cad2013
{
    public partial class IbForm : Form
    {
        DataSet m_dataSet;
        MyIbClass ib;
        public IbForm()
        {
            InitializeComponent();
            m_dataSet = new DataSet();
        }

        private void butOpenFile_Click(object sender, EventArgs e)
        {
            OpenFileDialog openDlg = new OpenFileDialog();
            openDlg.Filter = "gdb|*.gdb";
            if (openDlg.ShowDialog() == DialogResult.OK)
            {
                string sql = "select * from register order by id";
                ib = new MyIbClass(openDlg.FileName);
                m_dataSet = ib.GetDataSet(m_dataSet, sql);
                this.dataGridView1.DataSource = m_dataSet.Tables["table0"];
            }
        }

        private void butKgl_Click(object sender, EventArgs e)
        {
            string sql = "select * from kglsy";
            m_dataSet = ib.GetDataSet(m_dataSet, sql);
            //this.dataGridView1.DataSource = m_dataSet.Tables.
        }
    }
}
